﻿<%@ Page Title="Flight List" Language="C#" Culture="auto" UICulture="auto" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="LineFlights.aspx.cs" Inherits="IFD2.LineFlights" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label1" runat="server" Text="Origin:" meta:resourcekey="tipOrigin"></asp:Label>
                <asp:TextBox ID="txtOriCity" runat="server" CssClass="form-control input-sm" Width="100%" MaxLength=4></asp:TextBox>
                <asp:Label ID="Label2" runat="server" Text="Destination:" meta:resourcekey="tipDestination"></asp:Label>
                <asp:TextBox ID="txtDesCity" runat="server" CssClass="form-control input-sm" Width="100%" MaxLength=4></asp:TextBox>
                <asp:Label ID="Label3" runat="server" Text="Date:" meta:resourcekey="tipDate"></asp:Label>
                <asp:TextBox ID="txtFltDate" runat="server" CssClass="form-control input-sm" Width="100%" MaxLength=15></asp:TextBox>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
                            DataKeyNames="airline,flt_no,flt_date" DataSourceID="SqlDataSource1" ForeColor="#333333"
                            GridLines="None" style="min-width:1200px;width:100%;" class="table-hover">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <input name="KEY" type="radio" value='<%# Eval("flt_no")+"|"+Eval("flt_date")+"|"+Eval("airline") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Flight" meta:resourcekey="Flight">
                                    <ItemTemplate>
                                        <%# Eval("airline")%> <%#Eval("flt_no") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="status" HeaderText="status" SortExpression="status"  meta:resourcekey="status1" ItemStyle-HorizontalAlign="Center" />
                                <asp:BoundField DataField="dep_time" HeaderText="Dep. Time" SortExpression="dep_time"  meta:resourcekey="dep_time" />
                                <asp:BoundField DataField="arr_time" HeaderText="Arr. Time" SortExpression="arr_time"  meta:resourcekey="arr_time" />
                                <asp:BoundField DataField="tail_no" HeaderText="tail_no" SortExpression="tail_no"  meta:resourcekey="tail_no" />
                                <asp:BoundField DataField="ac_type" HeaderText="ac_type" SortExpression="ac_type"  meta:resourcekey="ac_type" />
                                <%--<asp:BoundField DataField="flt_type" HeaderText="flt_type" SortExpression="flt_type"  meta:resourcekey="flt_type" ItemStyle-HorizontalAlign="Center" />--%>
                                <asp:BoundField DataField="surcharge_type" HeaderText="surcharge_type" SortExpression="surcharge_type"  meta:resourcekey="surcharge_type" ItemStyle-HorizontalAlign="Center" />
                                <asp:CheckBoxField DataField="virtual" HeaderText="virtual" SortExpression="virtual" meta:resourcekey="virtual1" ItemStyle-HorizontalAlign="Center" />
                                <asp:TemplateField HeaderText="Op. Flight" meta:resourcekey="OpFlight">
                                    <ItemTemplate>
                                        <%# Eval("op_airline")%> <%#Eval("op_flt_no") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="done_user" HeaderText="done_user" SortExpression="done_user"  meta:resourcekey="done_user" />
                                <asp:BoundField DataField="done_time" HeaderText="done_time" SortExpression="done_time"  meta:resourcekey="done_time" />
                            </Columns>
                            <RowStyle BackColor="#EFF3FB" />
                            <EditRowStyle BackColor="#2461BF" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </div>
                    <div class="btn-group">
                        <asp:Button ID="btnRoute" CssClass="btn btn-sm btn-default" runat="server" Text="Route..." OnClick="btnRoute_Click" meta:resourcekey="Route" />
                        <asp:Button ID="btnControl" CssClass="btn btn-sm btn-default" runat="server" OnClick="btnControl_Click" Text="Seat Control..." meta:resourcekey="SeatControl" />
                        <asp:Button ID="btnLog" CssClass="btn btn-sm btn-default" runat="server" Text="Logs..." OnClick="btnLog_Click" meta:resourcekey="Logs" />
                        <asp:Button ID="btnClasses" CssClass="btn btn-sm btn-default" runat="server" Text="Classes...X" OnClick="btnClasses_Click" Visible="False"  meta:resourcekey="ClassesX" Enabled="False" />
                        <asp:Button ID="btnCabins" CssClass="btn btn-sm btn-default" runat="server" Text="Cabins...X" OnClick="btnCabins_Click" Visible="False"  meta:resourcekey="CabinsX" Enabled="False" />
                        <asp:Button ID="btnSegments" CssClass="btn btn-sm btn-default" runat="server" Text="Segments...X" Width="136px" OnClick="btnSegments_Click"  meta:resourcekey="Segments" Enabled="False" Visible="False" />
                    </div><br />
                    <div class="btn-group">
                        <asp:Button ID="btnPaxList" CssClass="btn btn-sm btn-default" runat="server" OnClick="btnPaxList_Click" Text="Unpaid Orders..." meta:resourcekey="UnpaidOrders" />
                        <asp:Button ID="btnStandBy" CssClass="btn btn-sm btn-default" runat="server" OnClick="btnStandBy_Click" Text="Stand By..."  meta:resourcekey="StandBy" />
                        <asp:Button ID="btnExpiried" CssClass="btn btn-sm btn-default" runat="server" OnClick="btnExpired_Click" Text="Expiried Orders..." meta:resourcekey="ExpiriedOrders"/>
                        <asp:Button ID="btnSaleIndex" CssClass="btn btn-sm btn-default" meta:resourcekey="SaleIndex" runat="server" Text="Sale Index..." OnClick="btnSaleIndex_Click" />
                        <asp:Button ID="btnTickets" CssClass="btn btn-sm btn-default" runat="server" OnClick="btnTickets_Click" Text="Tickets..." meta:resourcekey="Tickets" />
                        <asp:Button ID="btnCancelled" CssClass="btn btn-sm btn-default" runat="server" Text="Cancelled..." meta:resourcekey="CancelledOrders" OnClick="btnCancelled_Click" />
                        <asp:Button ID="btnTransferIn" CssClass="btn btn-sm btn-default" runat="server" OnClick="btnTransferIn_Click" Text="Transfer In..._X" meta:resourcekey="TransferIn" Enabled="False" Visible="False" />
                        <asp:Button ID="btnTransferOut" CssClass="btn btn-sm btn-default" runat="server" OnClick="btnTransferOut_Click" Text="Transfer Out..._X" meta:resourcekey="TransferOut" Enabled="False" Visible="False" />
                    </div><br />
                    <asp:Label ID="lblError" runat="server" CssClass="ifdMessage" Text=""></asp:Label>
                    <div class="well well-sm">
                        <asp:Label ID="Label5" runat="server" Text="Status:" meta:resourcekey="Status"></asp:Label>&nbsp;
                        <asp:DropDownList ID="lstStatus" runat="server">
                            <asp:ListItem Selected="True" Value="O" meta:resourcekey="Open">Open</asp:ListItem>
                            <asp:ListItem Value="L" meta:resourcekey="Locked">Locked</asp:ListItem>
                            <asp:ListItem Value="X" meta:resourcekey="Cancelled">Cancelled</asp:ListItem>
                        </asp:DropDownList>
                        <!--ListItem Value="F">Flown(最末段离港控制航班最终关闭)<ListItem-->
                        <asp:Button ID="btnSetStatus" CssClass="btn btn-sm btn-default" runat="server" Text=" Set " OnClick="btnSetStatus_Click"  meta:resourcekey="Set" />
                    </div>
                    <div class="well well-sm">
                        <div class="form-group">
                        <asp:Label ID="Label6" runat="server" Text="Change Aircraft:" meta:resourcekey="ChangeAircraft"></asp:Label>&nbsp;
                        <asp:DropDownList ID="lstTailNo" runat="server" DataSourceID="SqlDataSource2" DataTextField="tail_no" DataValueField="tail_no" ></asp:DropDownList>
                        </div>
                        <asp:Button CssClass="btn btn-sm btn-default" ID="btnSetTailNo" runat="server" Text="Change" OnClick="btnSetTailNo_Click"  meta:resourcekey="Change" /><br />
                        <asp:Label ID="Label7" runat="server" Text="Note: Lock the flight before changing and unlock it after changing !" meta:resourcekey="Note" Font-Italic="True"></asp:Label>
                    </div>
                    <div class="well well-sm">
                        <%--<div class="form-group">
                        <asp:Label ID="Label4" runat="server" Text="Flight Type:" meta:resourcekey="FltType"></asp:Label>
                        <asp:DropDownList ID="lstFltTypes" runat="server">
                            <asp:ListItem Selected="True">?</asp:ListItem>
                            <asp:ListItem>1</asp:ListItem>
                            <asp:ListItem>2</asp:ListItem>
                            <asp:ListItem>3</asp:ListItem>
                            <asp:ListItem>4</asp:ListItem>
                            <asp:ListItem>5</asp:ListItem>
                        </asp:DropDownList>
                        </div>--%>
                        <div class="form-group">
                        <asp:Label ID="Label12" runat="server" Text="Surcharge Type:" meta:resourcekey="SurchargeType"></asp:Label>
                        <asp:DropDownList ID="lstSurchargeTypes" runat="server">
                            <asp:ListItem Selected="True">?</asp:ListItem>
                            <asp:ListItem>1</asp:ListItem>
                            <asp:ListItem>2</asp:ListItem>
                            <asp:ListItem>3</asp:ListItem>
                            <asp:ListItem>4</asp:ListItem>
                            <asp:ListItem>5</asp:ListItem>
                            <asp:ListItem>6</asp:ListItem>
                            <asp:ListItem>7</asp:ListItem>
                            <asp:ListItem>8</asp:ListItem>
                            <asp:ListItem>9</asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <asp:Button ID="btnSetTypes" runat="server" CssClass="btn btn-sm btn-default" Text="Set" meta:resourcekey="Change" OnClick="btnSetTypes_Click" />
                    </div>
                </div>
            </div>
        </div>
    </div>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
        SelectCommand="bll_flt_search_by_segment_date" 
        SelectCommandType="StoredProcedure" DataSourceMode="DataReader" >
        <SelectParameters>
            <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
            <asp:ControlParameter ControlID="txtOriCity" Name="ori_city" PropertyName="Text"
                Type="String" />
            <asp:ControlParameter ControlID="txtDesCity" Name="des_city" PropertyName="Text"
                Type="String" />
            <asp:ControlParameter ControlID="txtFltDate" Name="flt_date" PropertyName="Text"
                Type="DateTime" />
        </SelectParameters>
    </asp:SqlDataSource>

    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
        SelectCommand="bll_aircraft_get_tail_nos" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
        <SelectParameters>
            <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>

    </div></form>

    <script src="JS/ScrollableGridPlugin.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var win_height = parseInt($(window).height());
            var tab_new_height= win_height-50-100;//菜单占50， 为便于操作留空100
            if ($('#<%=GridView1.ClientID %>').height()>tab_new_height)
                $('#<%=GridView1.ClientID %>').Scrollable({ ScrollHeight: tab_new_height });
        });
    </script>

</asp:Content>
